import axios from 'axios';

// 里程碑
export interface MilestoneRecord {
  id?: string;
  projectId: string;
  name: string;
  endTime: string;
  describe: string;
  createBy?: string;
  createDate?: string;
  updateBy?: string;
  updateDate?: string;
  deleteFlag?: number;
}

// 分页查询参数
export interface MilestoneSearchParams {
  pageNo: number;
  pageSize: number;
  projectId: string;
  name?: string;
  startTime?: string;
  endTime?: string;
}

// 查询里程碑列表
export function queryMilestoneList(params: MilestoneSearchParams) {
  return axios.get('/cde-collaboration/milestone/list', {
    params,
  });
}

// 新增里程碑
export function saveMilestone(params: MilestoneRecord) {
  return axios.post('/cde-collaboration/milestone/save', params);
}

// 编辑里程碑
export function updateMilestone(params: MilestoneRecord) {
  return axios.post('/cde-collaboration/milestone/update', params);
}
